<?php

namespace app\admin\controller\ai;

use app\common\controller\BaseController;
use hg\apidoc\annotation as Apidoc;
use app\common\service\ai\PointPriceService;

/**
 * @Apidoc\Title("点数价格管理")
 * @Apidoc\Group("")
 * @Apidoc\Sort("300")
 */
class PointPrice extends BaseController {

    /**
     * @Apidoc\Title("列表")
     * @Apidoc\Returned("list", type="array", desc="列表", children={
     * @Apidoc\Returned(ref="app\common\model\ai\PointPriceModel", withoutField="sdc"),
     * })
     */
    public function getList() {
        $list = PointPriceService::getListByAdmin($this->data);
        return success($list);
    }
    
    /**
     * @Apidoc\Title("详情")
     * @Apidoc\Param(ref="app\common\model\ai\PointPriceModel", field="id")
     * @Apidoc\Returned(ref="app\common\model\ai\PointPriceModel", withoutField="sdc"),
     * })
     */
    public function getDetail() {
        $result = PointPriceService::getDetailByAdmin($this->data);
        return success($result);
    }
    
    /**
     * @Apidoc\Title("新增")
     * @Apidoc\Method("POST")
     * @Apidoc\Param(ref="app\common\model\ai\PointPriceModel", field="sale_price,point")
     * })
     */
    public function add() {
        PointPriceService::add($this->data);
    }
    
    /**
     * @Apidoc\Title("编辑")
     * @Apidoc\Method("POST")
     * @Apidoc\Param(ref="app\common\model\ai\PointPriceModel", field="id,sale_price,point")
     * })
     */
    public function edit() {
        PointPriceService::edit($this->data);
    }
    
    /**
     * @Apidoc\Title("删除")
     * @Apidoc\Method("POST")
     * @Apidoc\Param(ref="app\common\model\ai\PointPriceModel", field="id")
     * })
     */
    public function del() {
        PointPriceService::del($this->data);
    }

}
